package com.wye.service.impl;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.wye.dao.CategoryMapper;
import com.wye.goods.pojo.Category;
import com.wye.service.CategoryService;
import org.apache.commons.lang.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.ArrayList;
import java.util.List;

@Service
public class CategoryServiceImpl implements CategoryService {

    private static Logger logger = LoggerFactory.getLogger(CategoryServiceImpl.class);

    @Autowired CategoryMapper categoryMapper;

    @Override
    public List<Category> findAll() {
        return categoryMapper.selectAll();
    }

    @Override
    public Category findById(Integer id) {
        return categoryMapper.selectByPrimaryKey(id);
    }

    @Override
    public int insert(Category category) {
        return categoryMapper.insertSelective(category);
    }

    @Override
    public void update(Category category) {
        categoryMapper.updateByPrimaryKeySelective(category);
    }

    @Override
    public void delete(Integer id) {
        categoryMapper.deleteByPrimaryKey(id);
    }

    @Override
    public List<Category> findList(Category Category) {
        return null;
    }

    @Override
    public PageInfo<Category> findPage(Integer page, Integer size) {
        return null;
    }

    @Override
    public PageInfo<Category> findPage(Integer page, Integer size, Category Category) {
        return null;
    }

    @Override
    public List<Category> findByParentId(Integer pid) {
        return categoryMapper.findByParentId(pid);
    }
}
